package com.kuangjia.conferenceroomrental.controller;

import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/test")
public class TestController {

    @GetMapping("/hello")
    public Map<String, String> helloGet() {
        Map<String, String> response = new HashMap<>();
        response.put("message", "Hello from GET endpoint!");
        return response;
    }

    @PostMapping("/hello")
    public Map<String, String> helloPost(@RequestBody(required = false) Map<String, Object> request) {
        Map<String, String> response = new HashMap<>();
        response.put("message", "Hello from POST endpoint!");
        response.put("received", request != null ? request.toString() : "no data");
        return response;
    }
} 